import request from '@/utils/request'

export function getTreeApi(regionNodeId) {
    return request({
        url: '/pointType/getTree',
        method: 'get',
        params: {regionNodeId}
    })
}

export function getDynamicAttrPageApi(data) {
    return request({
        url: '/pointType/getDynamicAttrPage',
        method: 'post',
        data
    })
}

export function saveModulePointsApi(data) {
    return request({
        url: '/pointType/saveModulePoints',
        method: 'post',
        data
    })
}

export function findFunctionListApi() {
    return request({
        url: '/pointType/findFunctionList',
        method: 'get',
    })
}

export function findModuleListApi(functionId) {
    return request({
        url: '/pointType/findModuleList',
        method: 'get',
        params: {functionId}
    })
}

// 新能功能信息
export function createFunctionApi(data) {
    return request({
        url: '/pointType/createFunction',
        method: 'POST',
        data: data
    })
}


// 编辑功能信息
export function editFunctionApi(data) {
    return request({
        url: '/pointType/editFunction',
        method: 'POST',
        data: data
    })
}

// 删除功能信息
export function deleteFunctionApi(id) {
    return request({
        url: '/pointType/deleteFunction',
        method: 'get',
        params: {id}
    })
}

// 查询功能信息
export function findFunctionApi(searchText) {
    return request({
        url: '/pointType/findFunction',
        method: 'get',
        params: {searchText}
    })
}


// 新增模块
export function createModuleApi(data) {
    return request({
        url: '/pointType/createModule',
        method: 'post',
        data: data
    })
}


// 删除模块
export function deleteModuleApi(id) {
    return request({
        url: '/pointType/deleteModule',
        method: 'get',
        params: {id}
    })
}